<template>
  <div>
    <el-container id="container">
      <el-header>
        RBAC <a @click="logout">安全退出</a>
        <br>
        <router-link to="/System/Permission">测试是否能访问Permission</router-link>
      </el-header>

      <el-container>
        <el-aside width="200px">
          <Menu></Menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Menu from "@/components/Menu.vue";
import { logout } from "@/api/auth/auth.js";
export default {
  methods: {
    logout() {
      logout().then((r) => {
        if (r.code == 200) {
          sessionStorage.removeItem("userId");
          sessionStorage.removeItem("hasRoute");
          this.$router.push("/Login");
          location.reload();
        }
      });
    },
  },
  components: {
    Menu,
  },
};
</script>

<style>
#container {
  height: 100vh;
}

.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  height: 100px;
  line-height: 25px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  line-height: 40px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>